﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MapData {
   
    /// <summary>
    /// An object which represents a line in a mapping system
    /// </summary>
    public class Line : MapObject {

        private List<SimplePoint> line;

        private string lineColor;
        private int lineWidth;


        /// <summary>
        /// Pre:
        /// Post: Constructs a line object with default values 
        /// for its lineColor and lineWidth;
        /// </summary>
        public Line() : base() {
            line = new List<SimplePoint>();
            lineColor = "000000";
            lineWidth = 1;
        }


        /// <summary>
        /// Pre:
        /// Post: Return or Sets the value of the Line's LineColor
        /// </summary>
        public string LineColor {
            get {
                return lineColor;
            }
            set {
                lineColor = value;
            }
        }


        /// <summary>
        /// Pre:
        /// Post: Return or Sets the value of the Line's LineWidth
        /// </summary>
        public int LineWidth {
            get {
                return lineWidth;
            }
            set {
                lineWidth = value;
            }
        }

        /// <summary>
        /// Pre: A SimplePoint needs to be created and passed to the function
        /// Post: Adds a new simple point to the line.
        /// </summary>
        /// <param name="point"></param>
        public void addPoint(SimplePoint point) {
            line.Add(point);
        }

        /// <summary>
        /// Pre: 
        /// Post: Returns an array of all the points in the line
        /// </summary>
        /// <returns></returns>
        public SimplePoint[] getPoints() {
            return line.ToArray();
        }
    }
}
